package com.oilsection.demo.po;

import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

/**
 * 注入点
 */
@Data
@TableName("zrd_table")
public class Zrd {
    @TableId(type = IdType.AUTO)
    private Long id;

    private String kqName;

    private String name;

    private String xPoint;

    private String yPoint;

    @TableField(exist = false)
    private String location;

    public String getLocation() {
        if (ObjUtil.isNotEmpty(location)) {
            return location;
        }
        return StrUtil.format("({},{})", xPoint, yPoint);
    }
}
